package com.lagou.edu.mapper;

import com.lagou.edu.entity.AuthCode;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * @Classname IUserMapper
 * @Date 2021/5/30 16:49
 * @Author ch'ien
 */

@Repository
public interface ICodeMapper {

    @Select("select * from lagou_auth_code where email =  #{email}  order By createtime desc limit 1 ")
    AuthCode getOneByCondition(@Param("email") String email);


    @Insert("insert into lagou_auth_code (email, code, createtime, expiretime) value (" +
            " #{email},#{code},#{createtime},#{expiretime}) ")
    int save(AuthCode authCode);

}
